package cleancode.datasource;

import java.io.File;

/**
 * Create proper DataSourceHandler based on given data source, it can be a database, or file, or remote url, etc.
 */
public class DataSourceHandlerFactory
{
    public static DataSourceHandler createDataSourceHandler( Object dataSource )
    {
        if( dataSource instanceof File )
        {
            return new DefaultFileDataSourceHandler( ( File ) dataSource );
        }
        return new DefaultDataSourceHandler();
    }
}
